﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace SpaceFight.Units.Steering
{
	interface ISteeringBehavior
	{
		void GetSteering(IUnit p_unit, SteeringOutput p_steeringOutput);
	}
	abstract class SteeringBehavior: ISteeringBehavior
	{
		abstract public void GetSteering(IUnit p_unit, SteeringOutput p_steeringOutput);

		protected bool HasValidInput(SteeringOutput p_steeringOutput, IUnit p_unit,
		                             SteeringInfo.InfoType p_neededInfo)
		{
			// check for valid input
			Debug.Assert(p_steeringOutput != null);
			if (p_steeringOutput == null)
			{
				return false;
			}
			Debug.Assert(p_unit != null);
			if (p_unit == null)
			{
				return false;
			}
			return p_unit.SteeringInfo.CheckMissingInfo(p_neededInfo);
		}
	}
}
